'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  // require('./router/blog')(app);
  // require('./router/user')(app);
  // require('./router/comment')(app);
  // require('./router/catalog')(app);
  // require('./router/stock')(app);
  // require('./router/user_stock')(app);
  // require('./router/stock_expect')(app);
  //require('./router/collect')(app);

  //	CRUD
  app.router.resources('user', '/api/v1/user', app.controller.user);
  app.router.resources('blog', '/api/v1/blog', app.controller.blog);
  app.router.resources('userStock', '/api/v1/userStock', app.controller.userStock);
  app.router.resources('catalog', '/api/v1/catalog', app.controller.catalog);
  app.router.resources('stockExpect', '/api/v1/stockExpect', app.controller.stockExpect);

  //	Login
  app.post('/api/v1/user/login', 'user.login');

  //	Stock import
  app.post('/api/v1/stock/import', 'stock.import');

  app.get('/api/v1/test', 'test.test');

  //	User
  // app.post('/api/users', 'user.create');
  // app.del('/api/users/:id', 'user.destroy');
  // app.put('/api/users/:id', 'user.update');
  // app.post('/api/users/login', 'user.login');
  // app.get('/api/users/:id', 'user.find');
  // app.get('/api/users/:id/edit', 'user.find');
};
